home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Imagine the Universe (9th Edition)
/
Imagine the Universe 9 - Disc 1.iso
/
pc
/
imagine
/
docs
/
science
/
try_l2
/
javascript
/
stars.js
< prev
next >
Wrap
Text File
|
2003-01-06
|
2KB
|
106 lines
size1 = "Blank";
size2 = "Blank";
size3 = "Blank";
size4 = "Blank";
size5 = "Blank";
size6 = "Blank";
function testButton(form) {
if (form.answer1)
size1 = form.answer1.selectedIndex;
if (form.answer2)
size2 = form.answer2.selectedIndex;
if (form.answer3)
size3 = form.answer3.selectedIndex;
if (form.answer4)
size4 = form.answer4.selectedIndex;
if (form.answer5)
size5 = form.answer5.selectedIndex;
if (form.answer6)
size6 = form.answer6.selectedIndex;
RightAnswer1 = "6";
RightAnswer2 = "5";
RightAnswer3 = "4";
RightAnswer4 = "1";
RightAnswer5 = "2";
RightAnswer6 = "3";
NumberCorrect = 0;
AnswerPage = 'stars_solution.html';
if (size1 == RightAnswer1) {
NumberCorrect++;
}
if (size2 == RightAnswer2) {
NumberCorrect++;
}
if (size3 == RightAnswer3) {
NumberCorrect++;
}
if (size4 == RightAnswer4) {
NumberCorrect++;
}
if (size5 == RightAnswer5) {
NumberCorrect++;
}
if (size6 == RightAnswer6) {
NumberCorrect++;
}
alert ("You answered " +NumberCorrect + " out of 6 questions correctly!");
if (NumberCorrect==6) {
location = AnswerPage;
}
}
function answerButton(form) {
if (form.answer1)
size1 = form.answer1.selectedIndex;
if (form.answer2)
size2 = form.answer2.selectedIndex;
if (form.answer3)
size3 = form.answer3.selectedIndex;
if (form.answer4)
size4 = form.answer4.selectedIndex;
if (form.answer5)
size5 = form.answer5.selectedIndex;
if (form.answer6)
size6 = form.answer6.selectedIndex;
RightAnswer1 = "6";
RightAnswer2 = "5";
RightAnswer3 = "4";
RightAnswer4 = "1";
RightAnswer5 = "2";
RightAnswer6 = "3";
NumberCorrect = 0;
AnswerPage = 'stars_solution.html';
if (size1 == RightAnswer1) {
NumberCorrect++;
}
if (size2 == RightAnswer2) {
NumberCorrect++;
}
if (size3 == RightAnswer3) {
NumberCorrect++;
}
if (size4 == RightAnswer4) {
NumberCorrect++;
}
if (size5 == RightAnswer5) {
NumberCorrect++;
}
if (size6 == RightAnswer6) {
NumberCorrect++;
}
alert ("You answered " +NumberCorrect + " out of 6 questions correctly!");
location = AnswerPage;
}